<html>
<head><meta charset="utf-8"><title>How relevant is `save_analysis` · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html">How relevant is `save_analysis`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199267881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199267881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199267881">(May 30 2020 at 17:43)</a>:</h4>
<p>Hello everyone!</p>
<p>There is an ongoing effort to get rid of <code>NodeId</code>s in the compiler but it seems one of the remaining user of <code>NodeId</code>s is the <code>save_analysis</code> crate. It appears to be running some kind of analysis pass based on the AST tree (hence <code>NodeId</code>s everywhere) but also rely on conversion to/from <code>DefId</code> and <code>HirId</code> which sometime fails because not every node gets assigned a def id or a hir id.</p>
<p>I am not familiar with this crate and I wonder what is it used for?<br>
Could/should it be updated to work on the HirId tree instead?</p>



<a name="199267932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199267932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199267932">(May 30 2020 at 17:44)</a>:</h4>
<p>Mostly it's for producing the data that the RLS consumes I believe</p>



<a name="199268095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199268095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199268095">(May 30 2020 at 17:48)</a>:</h4>
<p>Is RLS supposed to be replaced/superseeded by rust-analyzer somehow?</p>



<a name="199268113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199268113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199268113">(May 30 2020 at 17:49)</a>:</h4>
<p>Yes, the RFC for that just got merged, but it's still going to be a while until that happens</p>



<a name="199268188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199268188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199268188">(May 30 2020 at 17:51)</a>:</h4>
<p>Oh great! In the mean time, I am not sure what would be the way forward for removing NodeId's</p>



<a name="199268299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199268299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199268299">(May 30 2020 at 17:55)</a>:</h4>
<p>I could try to migrate it to HirId tree but i am not sure how worthwhile it would be. At the same time i'd probably learn a few things about the compiler by doing so :P</p>



<a name="199347225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199347225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199347225">(Jun 01 2020 at 08:39)</a>:</h4>
<p>So i tried  to port <code>save_analysis</code> to use HIR tree instead of AST and it seems to work!</p>



<a name="199359564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199359564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199359564">(Jun 01 2020 at 11:51)</a>:</h4>
<p>It might be a long shot, but here it is: <a href="https://github.com/rust-lang/rust/pull/72882">https://github.com/rust-lang/rust/pull/72882</a></p>



<a name="199373614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199373614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199373614">(Jun 01 2020 at 14:10)</a>:</h4>
<p>Well, against all odds, tests are passing now :)</p>



<a name="199408148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199408148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199408148">(Jun 01 2020 at 18:54)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="281572">@marmeladema</span>! Sorry I was busy last week, but nice work! Have you tried running the RLS test suite, specifically the ones in <a href="https://github.com/rust-lang/rls/tree/master/rls-analysis"><code>rls-analysis</code></a>?</p>



<a name="199408229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199408229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199408229">(Jun 01 2020 at 18:55)</a>:</h4>
<p>(I don't actually know if you can how to run RLS tests with a custom toolchain, maybe someone else can help?)</p>



<a name="199408327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199408327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199408327">(Jun 01 2020 at 18:56)</a>:</h4>
<p>Unfortunately, our tests for the save analysis don't really cover much at all</p>



<a name="199408337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199408337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199408337">(Jun 01 2020 at 18:56)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> might be able to help advise you in testing against the RLS</p>



<a name="199409820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199409820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199409820">(Jun 01 2020 at 19:07)</a>:</h4>
<p>I am running <code>./x.py test --stage 1 src/tools/rls</code> and it seems to work with a custom toolchain</p>



<a name="199409881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199409881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199409881">(Jun 01 2020 at 19:08)</a>:</h4>
<p>I have three failing tests that I don't know yet how to solve but at least its not catastrophic :)</p>



<a name="199431165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199431165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199431165">(Jun 01 2020 at 22:22)</a>:</h4>
<p>I have 3 failing tests with that PR and I am not sure how to fix those: <a href="https://github.com/rust-lang/rust/pull/72882#issuecomment-637156144">https://github.com/rust-lang/rust/pull/72882#issuecomment-637156144</a></p>



<a name="199520521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199520521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199520521">(Jun 02 2020 at 16:46)</a>:</h4>
<p>reviewed and posted comments on how the tests should be fixed</p>



<a name="199521440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199521440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199521440">(Jun 02 2020 at 16:54)</a>:</h4>
<p>Ok i will just try to fix the ideas then :)</p>



<a name="199522603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199522603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199522603">(Jun 02 2020 at 17:03)</a>:</h4>
<p>just posted the response here as an fyi for others :) I didn't post more than the two-sided index response</p>



<a name="199524162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199524162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199524162">(Jun 02 2020 at 17:15)</a>:</h4>
<p>I am trying to figure out how i am going to craft different ids using HirId/DefId and without using NodeId</p>



<a name="199524307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199524307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199524307">(Jun 02 2020 at 17:16)</a>:</h4>
<p>basically i need to fit 3 u32 into 1 lol</p>



<a name="199524538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199524538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199524538">(Jun 02 2020 at 17:19)</a>:</h4>
<p>Well more like two u32 into one</p>



<a name="199559317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199559317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199559317">(Jun 02 2020 at 21:58)</a>:</h4>
<p>Yep, saw the combination logic</p>



<a name="199559320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199559320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199559320">(Jun 02 2020 at 21:58)</a>:</h4>
<p>looks good, thanks!</p>



<a name="199559330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199559330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199559330">(Jun 02 2020 at 21:58)</a>:</h4>
<p>Sorry, having a hard time keeping track of Zulip chat</p>



<a name="199559360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199559360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199559360">(Jun 02 2020 at 21:59)</a>:</h4>
<p>out of curiosity, does that mean we won't have to maintain hir-&gt;node id mapping anymore?</p>



<a name="199592689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199592689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199592689">(Jun 03 2020 at 08:34)</a>:</h4>
<p>Thats the goal yes! But we are not quite done yet. But without any user of node ids directly, it will be easier to remove it.</p>



<a name="199592718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199592718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199592718">(Jun 03 2020 at 08:34)</a>:</h4>
<p>But there are challenges, especially because some <code>DefId</code> are not <code>HirId</code> owner like closure <code>DefId</code>s</p>



<a name="199731014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199731014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199731014">(Jun 04 2020 at 11:06)</a>:</h4>
<p>Could someone re-approve <a href="https://github.com/rust-lang/rust/pull/72882">https://github.com/rust-lang/rust/pull/72882</a> please? I think the failure was spurious</p>



<a name="199743166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199743166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199743166">(Jun 04 2020 at 13:05)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="211727">@Jonas Schievink</span> !</p>



<a name="199789715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199789715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199789715">(Jun 04 2020 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> should we merge the <code>hir</code> branch from rls repo?</p>



<a name="199789988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20relevant%20is%20%60save_analysis%60/near/199789988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20relevant.20is.20.60save_analysis.60.html#199789988">(Jun 04 2020 at 18:36)</a>:</h4>
<p>Yup! Will do that tonight</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>